package com.unisound.tracelog.client.core.model;


import com.unisound.tracelog.client.core.support.parameter.ParameterValue;

import java.util.HashMap;
import java.util.Map;

public class RootStartSpan extends StartSpan {

    /**
     * 标签键值对(如流水号可以写成 key=admissionId  value=c8e0666005f395c8809786660d5a41a4(真实业务值))
     * 支持多个
     */
    private Map<String, String> tagMap;

    public RootStartSpan() {}

    public static Map<String, String> simpleTagMap(String key, String value) {
        Map<String, String> tagMap = new HashMap<>();
        tagMap.put(key, value);
        return tagMap;
    }

    public RootStartSpan(String name, String serverName, Map<String, String> tagMap, Map<String, ParameterValue> parameterMap) {
        super(name, serverName, parameterMap);
        this.tagMap = tagMap;
    }

    public RootStartSpan(String name, String serverName, Integer type, Map<String, String> tagMap, Map<String, ParameterValue> parameterMap) {
        super(name, serverName, type, parameterMap);
        this.tagMap = tagMap;
    }

    public RootStartSpan(String name, String serverName, Map<String, String> tagMap) {
        super(name, serverName);
        this.tagMap = tagMap;
    }

    public Map<String, String> getTagMap() {
        return tagMap;
    }

    public void setTagMap(Map<String, String> tagMap) {
        this.tagMap = tagMap;
    }

}
